//
//  ___PROJECTNAMEASIDENTIFIER___AppDelegate.mm
//  ___PROJECTNAME___
//
//  Created by ___FULLUSERNAME___ on ___DATE___.
//  Copyright ___ORGANIZATIONNAME___ ___YEAR___ All rights reserved.
//

#import "___PROJECTNAMEASIDENTIFIER___AppDelegate.h"

@implementation ___PROJECTNAMEASIDENTIFIER___AppDelegate
@synthesize window;


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {  
	rootNode = [[vdNode alloc] init]; // Creating the root node
	
	/* Create the engine kernel*/
	[vdKernel createSharedKernelWithAPI:OpenGLESAPI2]; // We use OpenGLES 2.0 if possible
	[[vdKernel sharedKernel] attachToWindow:window]; // The engine view will be added to the window
	[[vdKernel sharedKernel] setMaxFPS:60]; // The max FPS is 60 (you may want to use smaller values like 30 ;)
	[[vdKernel sharedKernel] setRootNode:rootNode]; // Setting the root node...
	[[vdKernel sharedKernel] startRendering]; // ...and starting the rendering "loop"
	
    [window makeKeyAndVisible];
	
	return YES;
}


- (void)dealloc {
	[[vdKernel sharedKernel] destroy];
	
    [window release];
    [super dealloc];
}


@end
